#include<iostream>
#include<cstring> 
#include<vector>
#include<queue>
#include<numeric>
#define ll long long
#define ull unsigned long long
using namespace std;

const int N = 1e4 + 10, INF = 0x3f3f3f3f;

int n, m;
struct node {
    int x, y;
    char c;
}a[N];
vector<int> g[N];
int in[N];

struct DSU {
    std::vector<int> f, sz;
    DSU() {}
    DSU(int n) { init(n); }
    void init(int n) {
        n++;
        f.resize(n);
        std::iota(f.begin(), f.end(), 0);
        sz.assign(n, 1);
    }
    int find(int x) {
        while (x != f[x]) {
            x = f[x] = f[f[x]];
        }
        return x;
    }
    int size(int x) {
        return sz[find(x)];
    }
    bool merge(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y) return false;
        sz[x] += sz[y];
        f[y] = x;
        return true;
    }
    bool same(int x, int y) {
        return find(x) == find(y);
    }
};

void solve()
{
    while (cin >> n >> m) {
        memset(in, 0, sizeof in);
        for (int i = 0;i < n;i++) g[i].clear();
        DSU dsu(n);int cnt = n;
        for (int i = 0;i < m;i++) {
            cin >> a[i].x >> a[i].c >> a[i].y;
            if (a[i].c == '=' && dsu.same(a[i].x, a[i].y) == 0) { dsu.merge(a[i].x, a[i].y); cnt--; }
        }
        for (int i = 0;i < m;i++) {
            if (a[i].c == '=') continue;
            int fx = dsu.find(a[i].x);
            int fy = dsu.find(a[i].y);
            if (a[i].c == '>') {
                g[fx].push_back(fy);
                in[fy]++;
            } else {
                g[fy].push_back(fx);
                in[fx]++;
            }
        }

        int flag = 1;
        queue<int> q;
        for (int i = 0;i < n;i++) if (in[dsu.find(i)] == 0 && i == dsu.find(i)) q.push(dsu.find(i));
        while (!q.empty()) {
            if (q.size() >= 2) flag = 0;
            int x = q.front();q.pop();cnt--;
            for (int y : g[x]) {
                in[y]--;
                if (in[y] == 0) q.push(y);
            }
        }
        if (cnt != 0) cout << "CONFLICT\n";
        else if (flag == 0) cout << "UNCERTAIN\n";
        else cout << "OK\n";
    }
}

signed main()
{
    //ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    int T = 1;
    //cin>>T;
    for (int i = 1;i <= T;i++) {
        solve();
    }
}